package com.vcs.frm.dao.company;

import org.apache.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;

import com.vcs.frm.domain.Employee;
import com.vcs.frm.domain.User;

public class EmployeeDaoImpl implements EmployeeDao{

	private final Logger log = Logger.getLogger(this.getClass());

	@Autowired
	private SessionFactory sessionFactory;
	private HibernateTemplate hibernateTemplate;

	
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
		this.hibernateTemplate = new HibernateTemplate(sessionFactory);
	}

	
	@Override
	public Employee getEmployeeById(Long employeeId) {
		log.info("method - getEmployeeById");
		Session session = sessionFactory.getCurrentSession();
		Employee emp =(Employee) session.get(Employee.class, employeeId); 
		return emp;
	}
	

}
